package thread;

import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了");

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数字：");
        try {
            int time = sc.nextInt();
            for (int i = time ; i > 0 ; i--){
                System.out.println(i);
            Thread.sleep(1000);// sleep是线程的静态方法

            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("程序结束了");
    }
}
